package cate.game.event;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class GameEventDispatcherImpl implements GameEventDispatcher{
    protected GameEventLoader<GameEvent> gameEventLoader;

    public GameEventDispatcherImpl(){
        gameEventLoader = new GameEventLoader<>();
    }

    @Override
    public void dispatchEvent(GameEvent event) {
        gameEventLoader.dispatchEvent(event);
    }

    @Override
    public void registeListener(GameEventListener<GameEvent> listener) {
        try{
            gameEventLoader.registe(listener);
        }catch(Exception e){
            log.error("注册监听失败, e=",e);
        }
    }
}
